package com.imti.mall.sale.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.imti.mall.model.sms.pojo.SmsHomeRecommendSubject;
import com.imti.mall.sale.dao.SmsHomeRecommendSubjectDao;
import com.imti.mall.sale.service.SmsHomeRecommendSubjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class SmsHomeRecommendSubjectServiceImpl extends ServiceImpl<SmsHomeRecommendSubjectDao, SmsHomeRecommendSubject> implements SmsHomeRecommendSubjectService
{
    @Autowired
    SmsHomeRecommendSubjectDao smsHomeRecommendSubjectDao;
    /**
     * 查询首页专题推荐表
     */
    @Override
    public List<SmsHomeRecommendSubject> findSmsHomeRecommendSubject(SmsHomeRecommendSubject smsHomeRecommendSubject,Integer pageSize, Integer pageNum) {
        PageHelper.startPage(pageNum, pageSize);
        return smsHomeRecommendSubjectDao.findSmsHomeRecommendSubject(smsHomeRecommendSubject);
    }
    /**
     * 修改首页专题推荐表
     * @param smsHomeRecommendSubject
     * @return
     */
    @Override
    public Integer updateSmsHomeRecommendSubject(SmsHomeRecommendSubject smsHomeRecommendSubject) {
        return smsHomeRecommendSubjectDao.updateSmsHomeRecommendSubject(smsHomeRecommendSubject);
    }
    /**
     * 根据id删除首页专题推荐
     * @param id
     * @return
     */
    @Override
    public Integer delSmsHomeRecommendSubject(Integer id) {
        return smsHomeRecommendSubjectDao.deleteById(id);
    }
    /**
     * 添加首页专题推荐
     * @param smsHomeRecommendSubject
     * @return
     */
    @Override
    public Integer addSmsHomeRecommendSubject(SmsHomeRecommendSubject smsHomeRecommendSubject) {
        return smsHomeRecommendSubjectDao.insert(smsHomeRecommendSubject);
    }
}
